package com.hxd.otc.module.my.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.hxd.otc.R;
import com.hxd.otc.base.BaseActivity;
import com.hxd.otc.module.my.bean.MessageBean;
import com.hxd.otc.module.my.contract.AfficheDetailContract;
import com.hxd.otc.module.my.presenter.AfficheDetailPresenter;
import com.hxd.otc.utils.DateUtil;
import com.hxd.otc.widget.TitleBar;

import butterknife.BindView;

/**
 * Created by lzy on 2018/6/22 0022.
 * description ${消息详情}
 */
public class MessageDetailActivity extends BaseActivity<AfficheDetailPresenter> implements AfficheDetailContract.View {
    @BindView(R.id.title_bar)
    TitleBar mTitleBar;
    @BindView(R.id.tv_title_real)
    TextView mTvTitle;
    @BindView(R.id.tv_content)
    TextView mTvContent;
    @BindView(R.id.tv_time)
    TextView mTvTime;

    public static final String EXTRA_MESSAGE_DETAIL = "messageDetail";

    @Override
    protected int getLayoutId() {
        return R.layout.activity_message_detail;
    }

    @Override
    protected AfficheDetailPresenter createPresenter() {
        return new AfficheDetailPresenter(this);
    }

    @Override
    protected void initView() {
        Bundle bundle = getBundle();
        MessageBean messageBean = (MessageBean) bundle.getSerializable(EXTRA_MESSAGE_DETAIL);
        assert messageBean != null;
        mTvTitle.setText(messageBean.getTitle());
        mTvContent.setText(messageBean.getContent());
        mTvTime.setText(DateUtil.format(Long.parseLong(messageBean.getCreateDate()), DateUtil.YY_MM_DD_HH_MM_SS));
    }

    @Override
    protected void initData() {
    }

    @Override
    protected void initEvent() {
    }
}
